import request from '@/utils/request';
// 查询商品类别列表
export function listCategory(query) {
  return request({
    url: '/category/list',
    method: 'get',
    params: query
  })
}

// 查询商品类别
export function getCategory(categoryId) {
  return request({
    url: '/category/' + categoryId,
    method: 'get'
  })
}

// 新增商品类别
export function addCategory(data) {
  return request({
    url: '/category',
    method: 'post',
    data: data
  })
}

// 修改商品类别
export function updateCategory(categoryId) {
  return request({
    url: '/category',
    method: 'put',
    data: categoryId
  })
}

// 删除商品类别
export function deleteCategory(categoryId) {
  return request({
    url: '/category/delete/' + categoryId,
    method: 'delete'
  })
}